/*
 * iacmd.h
 *
 *  Created on: 2013/01/31
 *      Author: fit
 */

#ifndef IACMD_H_
#define IACMD_H_

#include "utility/iadef.h"

#define DEF_BUF_SIZE 8U

class iacmd
{
	// member variables
	unsigned char* m_buf;
	unsigned int m_size;

	// member functions
public:
	iacmd();
	iacmd(const void* _buf, unsigned int _n);
	virtual ~iacmd();

	// create command
	void settype(cmd_type type);
	void add(unsigned char param, unsigned char cnt = 0, void* value = NULL);	// set data
	unsigned int read(void* _buf, unsigned int _n) const;

	// get command status
	cmd_type cmd() const;
	unsigned char count() const;
	const SET_DATA* operator [] (unsigned int index) const;
};

#endif /* IACMD_H_ */
